<?php

//ctype_space(mixed $text): bool
//ctype_space — 检测空白字符

$aa = "\n\r\t";
$bb = "\narf12";
$cc = "\n\r\t' ";
if (ctype_space($aa)) {
    echo '$aa ' . "ok" . PHP_EOL;
} else {
    echo '$aa ' . "no" . PHP_EOL;

}

if (ctype_space($bb)) {
    echo '$bb ' . "ok" . PHP_EOL;
} else {
    echo '$bb ' . "no" . PHP_EOL;

}
if (ctype_space($cc)) {
    echo '$cc ' . "ok" . PHP_EOL;
} else {
    echo '$cc ' . "no" . PHP_EOL;

}
